-- CALC_NORMAL_GIFT_BONUS

-------------------------------
-- 计算礼包奖励
-- @param args 奖励参数
return function(args, backupArg)
    -- GiftM中已经做了deepcopy，这里直接修改参数值不会影响
    local i;
    for i = 1, #args do
        if args[i][1] == 1 and type(args[i][2]) == "number" and
           ItemM.query(args[i][2], "type") == ITEM_TYPE_ARTIFACT and
           ItemM.getAmount(ME.user, args[i][2]) > 0 then
            args[i] = backupArg;
        end
    end

    return args;
end
